    ...
    <% // We're doing this in a JSP here, but in your own app you'll want to put
    // this logic in your MVC framework of choice.
    String captcha = (String) session.getAttribute("captcha");
    String answer = request.getParameter("answer");
    
    if (captcha.equals(answer)) { %>
        <b>Correct!</b>
    <% } %>
<%= captcha+" "+answer%>